<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app" style="background-color: rgb(255, 127, 251);height: 500px;">
        <div style="background-color: aquamarine;height: 200px;" v-on:click.self="divEvent" id="app1" >
            <input type="button" value="另类点击事件" v-on:click="btnEvent">
        </div>
        <input type="button" value="点击" v-on:click.once="btnEvent">这个按钮只有第一次才会有效


    </div>
</body>
<script>
    var vm = new Vue({
        el: "#app",
        data: {},
        methods: {
            divEvent: function () {
                alert('这是div事件')
            }, btnEvent: function () {
                alert("这是btn事件")
            }
        }
    })
</script>

</html>